<template>
  <div class="layout">
      <div class="left-menu">
            <Menu theme="dark" @on-select="menuSelect" :open-names="[1]" accordion="true">
              <Submenu :name="index" v-for="(item,index) in $router.options.routes" :key="index" v-if="!item.hidden">
                <template slot="title">
                    <Icon type="ios-paper"></Icon>
                    {{item.title}}
                </template>
                <MenuItem :name="subItem.name" v-for="(subItem,subIndex) in item.children" :key="subIndex">{{subItem.title}}</MenuItem>
            </Submenu>
          </Menu>
          <!--div><router-link to="layout1">框架1</router-link></div>
          <div><router-link to="layout2">框架2</router-link></div>
          <div><router-link to="layout3">框架3</router-link></div>
          <div><router-link to="layout4">框架4</router-link></div>
          <div><router-link to="layout5">框架5</router-link></div>
          <div><router-link to="layout6">框架6</router-link></div-->
      </div>
      <div>
          <router-view></router-view>
      </div>
  </div>
</template>

<script>
    export default {
        methods: {
            // 选中菜单，触发的事件
            menuSelect (name) {
                this.$router.push({ "name": name });
            }
        }
    }
</script>
<style lang="scss">
    @import '../../../zlst/style/public.scss';
    @import '../../../zlst/style/lib/zlst/zlstIndex.scss';
    @import '../../assets/style/sdkStyleIndex.scss';
    body {
        background-color: #f8f9fa;
    }
</style>
<style scoped lang="scss">
    .layout{
        background: #f8f9fa;
        .left-menu {
            position: fixed;
            background: #363e4f;
            top:200px;
            bottom:200px;
            overflow-y: auto;
            overflow-x: hidden;
            left: 20px;
            width: 240px;
            text-align: center;
            color: #fff;
            z-index:100;
            a{
                color:#fff;
                line-height: 40px;
            }
        }
    }


</style>
